package lancooControl;

import android.content.Context;
import android.view.LayoutInflater;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.hyznbk.R;

import java.text.DecimalFormat;

/**
 * Created by Administrator on 2017/9/13/013.
 */

public class CustomRateSetScore extends RelativeLayout {

    private TextView TvIndex;
    private TextView TvAnswer;
    public RadioGroup Rg;
    public CustomEditText EdtScore;

    public CustomRateSetScore(Context context) {
        super(context);

        // 加载布局
        LayoutInflater.from(context).inflate(R.layout.layout_rate_4, this);

        // 获取控件
        TvIndex = (TextView) findViewById(R.id.tv_index);
        TvAnswer = (TextView) findViewById(R.id.tv_answer);
        Rg = (RadioGroup) findViewById(R.id.rg);
        Rg.setVisibility(INVISIBLE);
        EdtScore = (CustomEditText) findViewById(R.id.edt_score);
        EdtScore.setVisibility(VISIBLE);

    }

    public void setRateScore(int index,String answer,String stuAssess){
         /*
        * 显示题号
        * */
        DecimalFormat df=new DecimalFormat("00");
        String ID=df.format(index);
        TvIndex.setText(ID);
        /*
        * 显示参考答案
        * */
        TvAnswer.setText(answer);
        /*
        * 显示自评结果
        * */
        EdtScore.setText(stuAssess);
    }

}